package com.bridgeintelligent.tag.customer.ess;

import lombok.Data;

import java.io.Serializable;

@Data
public class EssResp implements Serializable {

    private static final int SUCCESS = 0;

    private static final int ERROR = -1;

    private Integer code;

    private String message;

    private Object data;

    private EssResp(){}

    public static EssResp ok(){
        EssResp resp = new EssResp();
        resp.setCode(SUCCESS);
        resp.setMessage("操作成功");
        return resp;
    }
    public static EssResp ok(Object data){
        EssResp resp = new EssResp();
        resp.setCode(SUCCESS);
        resp.setData(data);
        resp.setMessage("操作成功");
        return resp;
    }

    public static EssResp error(String message){
        EssResp resp = new EssResp();
        resp.setCode(ERROR);
        resp.setMessage(message);
        return resp;
    }
}
